home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / fp.h < prev    next >
Text File  |  1995-09-01  |  27KB  |  619 lines

  1. /*******************************************************************************
  2. *                                                                              *
  3. *      File fp.h   -   PowerPC and 68K Macintosh                               *
  4. *                                                                              *
  5. *      A collection of numerical functions designed to facilitate a wide       *
  6. *      range of numerical programming. It is modeled after the Floating-Point  *
  7. *      C Extensions (FPCE) proposed technical draft of the Numerical C         *
  8. *      Extensions Group's requirements (NCEG / X3J11.1).                       *
  9. *      The <fp.h> declares many functions in support of numerical programming. *
  10. *      It provides a superset of <math.h> and <sane.h> functions.  Some        *
  11. *      functionality previously found in <sane.h> and not in the FPCE <fp.h>   *
  12. *      can be found in this <fp.h> under the heading "__NOEXTENSIONS__".       *
  13. *                                                                              *
  14. *      All of these functions are IEEE 754 aware and treat exceptions, NaNs,   *
  15. *      positive and negative zero and infinity consistent with the floating-   *
  16. *      point standard.                                                         *
  17. *                                                                              *
  18. *      Copyright © 1992-1995 Apple Computer, Inc.  All rights reserved.        *
  19. *                                                                              *
  20. *      Written by Ali Sazegari, started on July 1992,                          *
  21. *      based on the file Numerics.h by Jim Thomas.                             *
  22. *                                                                              *
  23. *      October    27  1992: made changes for PowerPC, transfered some power    *
  24. *                           functions to <faux.h>.                             *
  25. *      October    30  1992: added long double data type for PowerPC and        *
  26. *                           merged it with the Macintosh <fp.h>.               *
  27. *      December   10  1992: changed logb, scalb, frexp and ldexp to            *
  28. *                           LOGB, SCALB, FREXP and LDEXP to avoid collision    *
  29. *                           with the ibm libc.                                 *
  30. *      December   16  1992: changed the flag "powerpc" to "powerc"             *
  31. *      February   17  1993: removed the typedefs and defrerred them to         *
  32. *                           <Types.h>.                                         *
  33. *      May        18  1993: added binary to decimal conversions for the        *
  34. *                           PowerPC.                                           *
  35. *      June       14  1993: added the long double decimal conversions, changed *
  36. *                           the decimal conversion prototypes to double_t.     *
  37. *      July       11  1993: changed the names of the long double bin2dec.      *
  38. *      August     23  1993: included C++ extern "C" wrappers to make them C++  *
  39. *                           friendly.                                          *
  40. *      November   29  1993: corrected a spelling mistake in the comments.      *
  41. *      February   22  1994: modf changed to double_t for 68K compatability PAF *
  42. *      February   22  1994: Comment changes PAF                                *
  43. *      April      26  1994: #define SIGDIGLEN 20 for 68K PAF                   *
  44. *      April      28  1994: collected all powerpc specific calls, changed      *
  45. *                           DECIMAL_DIG to 17.                                 *             
  46. *      May         2  1994: Added dec2d prototype and function to fp68K.c      *
  47. *      May         4  1994: Added #ifndef powerc prototype for trunc           *
  48. *      June       23  1994: Changed __inf() prototype to double_t.             *
  49. *     January    17  1995: Remove C++ comments.  Use ConditionalMacros.h      *
  50. *      March      29  1995: Added definitions for 68k based transfer functions *
  51. *                           and MathLib v2 double to 68k long double transfer  *
  52. *                           functions.  Corrected some comments.               *
  53. *                                                                              *
  54. *******************************************************************************/
  55.  
  56. #ifndef __FP__
  57. #define __FP__
  58.  
  59. /*      efficient types are included in Types.h.                              */
  60.  
  61. #ifndef __TYPES__
  62. #include <Types.h>
  63. #endif
  64.  
  65. /*******************************************************************************
  66. *                              Define some constants.                          *
  67. *******************************************************************************/
  68.  
  69. #define      LONG_DOUBLE_SIZE           sizeof(long double)
  70. #define      DOUBLE_SIZE               sizeof(double)
  71.  
  72. #define      HUGE_VAL                  __inf()
  73. #define      INFINITY                  __inf()
  74. #define      NAN                        nan("255")
  75.  
  76. /*    the macro DECIMAL_DIG is obtained by satisfying the constraint that the
  77.       conversion from double to decimal and back is the identity function.   */
  78.  
  79. #if      GENERATINGPOWERPC
  80. #define      DECIMAL_DIG              17 /* does not exist for double-double */
  81. #else
  82. #define      DECIMAL_DIG              21
  83. #endif      
  84.  
  85. #ifdef __cplusplus
  86. extern "C" {
  87. #endif
  88. /*******************************************************************************
  89. *                            Trigonometric functions                           *
  90. *******************************************************************************/
  91.  
  92. double_t cos ( double_t x );
  93. double_t sin ( double_t x );
  94. double_t tan ( double_t x );
  95.  
  96. double_t acos ( double_t x );                /*  result is in [0,pi]          */
  97. double_t asin ( double_t x );                /*  result is in [-pi/2,pi/2]    */
  98. double_t atan ( double_t x );                /*  result is in [-pi/2,pi/2]    */
  99.  
  100. /*    atan2 computes the arc tangent of y/x in [-pi,pi] using the sign of
  101.       both arguments to determine the quadrant of the computed value.         */
  102.  
  103. double_t atan2 ( double_t y, double_t x );
  104.  
  105. /*******************************************************************************
  106. *                              Hyperbolic functions                            *
  107. *******************************************************************************/
  108.  
  109. double_t cosh ( double_t x );
  110. double_t sinh ( double_t x );
  111. double_t tanh ( double_t x );
  112.  
  113. double_t acosh ( double_t x );
  114. double_t asinh ( double_t x );
  115. double_t atanh ( double_t x );
  116.  
  117. /*******************************************************************************
  118. *                              Exponential functions                           *
  119. *******************************************************************************/
  120.  
  121. double_t exp ( double_t x );
  122.  
  123. /*    expm1 computes the base e exponential of the argument minus 1,
  124.       i. e., exp(x) - 1.  For small enough arguments, expm1 is expected
  125.       to be more accurate than the straight forward computation of exp(x) - 1.*/
  126.  
  127. double_t expm1  ( double_t x );
  128. double_t exp2  ( double_t x );
  129.  
  130. double_t frexp ( double_t x, int *exponent );
  131. double_t ldexp ( double_t x, int n );
  132.  
  133. double_t log ( double_t x );
  134. double_t log2 ( double_t x );
  135.  
  136. /*    log1p computes the base e logorithm of 1 plus the argument,
  137.       i. e., log (1+x).  For small enough arguments, log1p is expected
  138.       to be more accurate than the straightforward computation of log (1+x).  */
  139.  
  140. double_t log1p ( double_t x );
  141. double_t log10 ( double_t x ); 
  142.  
  143. /*    logb extracts the exponent of its argument, as a signed integral
  144.       value. A subnormal argument is treated as though it were first
  145.       normalized. Thus
  146.  
  147.       1 <= x * 2^( - Logb ( x ) ) < 2                                         */
  148.  
  149. double_t logb ( double_t x );
  150.  
  151. long double modfl ( long double x, long double *iptrl );
  152. double_t    modf  ( double_t x, double_t *iptr );  /* <- note NCEG difference */
  153. float       modff ( float x, float *iptrf );
  154.  
  155. /*    scalb computes x * 2^n efficently.  This is not normally done by
  156.       computing 2^n explicitly.                                               */
  157.  
  158. double_t scalb ( double_t x, long int n ); 
  159.  
  160. /*******************************************************************************
  161. *                     Power and absolute value functions                       *
  162. *******************************************************************************/
  163.  
  164. double_t fabs ( double_t x );
  165.  
  166. /*    hypot computes the square root of the sum of the squares of its
  167.       arguments, without undue overflow or underflow.                         */
  168.  
  169. double_t hypot ( double_t x, double_t y );
  170. double_t pow   ( double_t x, double_t y );
  171. double_t sqrt  ( double_t x );
  172.  
  173. /*******************************************************************************
  174. *                        Gamma and Error functions                             *
  175. *******************************************************************************/
  176.  
  177. double_t erf  ( double_t x );            /*   the error function              */
  178. double_t erfc ( double_t x );            /*   complementary error function    */
  179.  
  180. double_t gamma ( double_t x );
  181.  
  182. /*    lgamma computes the base-e logarithm of the absolute value of
  183.       gamma of its argument x, for x > 0.                                     */
  184.  
  185. double_t lgamma ( double_t x );
  186.  
  187. /*******************************************************************************
  188. *                        Nearest integer functions                             *
  189. *******************************************************************************/
  190.  
  191. double_t ceil  ( double_t x );
  192. double_t floor ( double_t x ); 
  193.  
  194. /*    the rint function rounds its argument to an integral value in floating
  195.       point format, honoring the current rounding direction.                  */
  196.  
  197. double_t rint ( double_t x );
  198.  
  199. /*    nearbyint differs from rint only in that it does not raise the
  200.       inexact exception. It is the nearbyint function recommended by the
  201.       IEEE floating-point standard 854.                                       */
  202.  
  203. double_t nearbyint ( double_t x );
  204.  
  205. /*    the function rinttol rounds its argument to the nearest long int using
  206.       the current rounding direction.
  207.       >>Note that if the rounded value is outside the range of long int, then
  208.       the result is undefined.                                                */
  209.  
  210. long int rinttol ( double_t x );
  211.  
  212. /*    the round function rounds the argument to the nearest integral value
  213.       in double format similar to the Fortran "anint" function.  That is:
  214.       add half to the magnitude and chop.                                     */
  215.  
  216. double_t round ( double_t x );
  217.  
  218. /*    roundtol is similar to the Fortran function nint or to the Pascal round
  219.       >>Note that if the rounded value is outside the range of long int, then
  220.       the result is undefined.                                                */
  221.  
  222. long int roundtol ( double_t round );
  223.  
  224. /*    trunc computes the integral value, in floating format, nearest to
  225.       but no larger in magnitude than its argument.                           */
  226.  
  227. #if  GENERATING68K
  228. /* necessary because trunc is implicitly declared this way when -elems881 is set */
  229. int      trunc ( double_t x );      /*  Round to integer in direction of zero */
  230. #else
  231. double_t trunc ( double_t x );
  232. #endif
  233.  
  234. /*******************************************************************************
  235. *                            Remainder functions                               *
  236. *******************************************************************************/
  237.  
  238. double_t fmod ( double_t x, double_t y );
  239.  
  240. /*    the following two functions compute the remainder.  remainder is required
  241.       by the IEEE 754 floating point standard. The second form correponds to the
  242.       SANE remainder; it stores into 'quotient' the 7 low-order bits of the
  243.       integer quotient x/y, such that -127 <= quotient <= 127.                */
  244.  
  245. double_t remainder ( double_t x, double_t y );
  246. double_t remquo    ( double_t x, double_t y, int *quo );
  247.  
  248. /*******************************************************************************
  249. *                             Auxiliary functions                              *
  250. *******************************************************************************/
  251.  
  252. /*    copysign produces a value with the magnitude of its first argument
  253.       and sign of its second argument. NOTE: the order of the arguments
  254.       matches the recommendation of the IEEE 754 floating point standard,
  255.       which is opposite from the SANE copysign function.                      */
  256.  
  257. double_t copysign ( double_t x, double_t y );
  258.  
  259. /*    the call 'nan ( "n-char-sequence" )' returns a quiet NaN with content
  260.       indicated through tagp in the selected data type format.                */
  261.  
  262. long double nanl ( const char *tagp );
  263. double      nan  ( const char *tagp );
  264. float       nanf ( const char *tagp );
  265.  
  266. /*    these compute the next representable value, in the type indicated,
  267.       after 'x' in the direction of 'y'.  if x == y then y is returned.       */
  268.  
  269. long double nextafterl ( long double x, long double y );
  270. double      nextafterd ( double x, double y );
  271. float       nextafterf ( float x, float y );
  272.  
  273. /*******************************************************************************
  274. *                              Inquiry macros                                  *
  275. *******************************************************************************/
  276.  
  277. enum NumberKind
  278.             {
  279.             FP_SNAN = 0,        /*      signaling NaN                         */
  280.             FP_QNAN,            /*      quiet NaN                             */
  281.             FP_INFINITE,        /*      + or - infinity                       */
  282.             FP_ZERO,            /*      + or - zero                           */
  283.             FP_NORMAL,          /*      all normal numbers                    */
  284.             FP_SUBNORMAL        /*      denormal numbers                      */
  285.             };
  286.  
  287. #define      fpclassify(x)    ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  288.                               __fpclassify  ( x ) :                            \
  289.                                 ( sizeof ( x ) == DOUBLE_SIZE ) ?              \
  290.                               __fpclassifyd ( x ) :                            \
  291.                               __fpclassifyf ( x ) )
  292.  
  293. /*    isnormal is non-zero if and only if the argument x is normalized.       */
  294.  
  295. #define      isnormal(x)      ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  296.                               __isnormal ( x ) :                               \
  297.                                 ( sizeof ( x ) == DOUBLE_SIZE ) ?              \
  298.                               __isnormald ( x ) :                              \
  299.                               __isnormalf ( x ) )
  300.  
  301. /*    isfinite is non-zero if and only if the argument x is finite.           */
  302.  
  303. #define      isfinite(x)      ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  304.                               __isfinite ( x ) :                               \
  305.                                 ( sizeof ( x ) == DOUBLE_SIZE ) ?              \
  306.                               __isfinited ( x ) :                              \
  307.                               __isfinitef ( x ) )
  308.  
  309. /*    isnan is non-zero if and only if the argument x is a NaN.               */
  310.  
  311. #define      isnan(x)         ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  312.                               __isnan ( x ) :                                  \
  313.                               ( sizeof ( x ) == DOUBLE_SIZE ) ?                \
  314.                               __isnand ( x ) :                                 \
  315.                               __isnanf ( x ) )
  316.  
  317. /*    signbit is non-zero if and only if the sign of the argument x is
  318.       negative. this includes, NaNs, infinities and zeros.                    */
  319.  
  320. #define      signbit(x)       ( ( sizeof ( x ) == LONG_DOUBLE_SIZE ) ?         \
  321.                               __signbit ( x ) :                                \
  322.                               ( sizeof ( x ) == DOUBLE_SIZE ) ?                \
  323.                               __signbitd ( x ) :                               \
  324.                               __signbitf ( x ) )
  325.  
  326. /*******************************************************************************
  327. *                      Max, Min and Positive Difference                        *
  328. *******************************************************************************/
  329.  
  330. /*    These extension functions correspond to the standard functions, dim
  331.       max and min.
  332.  
  333.       The fdim function determines the 'positive difference' between its
  334.       arguments: { x - y, if x > y }, { +0, if x <= y }.  If one argument is
  335.       NaN, then fdim returns that NaN.  if both arguments are NaNs, then fdim
  336.       returns the first argument.                                             */
  337.  
  338. double_t fdim ( double_t x, double_t y );
  339.  
  340. /*    max and min return the maximum and minimum of their two arguments,
  341.       respectively.  They correspond to the max and min functions in FORTRAN.
  342.       NaN arguments are treated as missing data.  If one argument is NaN and
  343.       the other is a number, then the number is returned.  If both are NaNs
  344.       then the first argument is returned.                                    */
  345.  
  346. double_t fmax ( double_t x, double_t y );
  347. double_t fmin ( double_t x, double_t y );
  348.  
  349. /*******************************************************************************
  350. *                                Constants                                     *
  351. *******************************************************************************/
  352.  
  353. extern const double_t pi;
  354.  
  355. /*******************************************************************************
  356. *                              Internal prototypes                             *
  357. *******************************************************************************/
  358.  
  359. long int __fpclassify  ( long double x ); 
  360. long int __fpclassifyd ( double x );
  361. long int __fpclassifyf ( float x );
  362.  
  363. long int __isnormal  ( long double x );
  364. long int __isnormald ( double x );
  365. long int __isnormalf ( float x );
  366.  
  367. long int __isfinite  ( long double x );
  368. long int __isfinited ( double x );
  369. long int __isfinitef ( float x );
  370.  
  371. long int __isnan  ( long double x );
  372. long int __isnand ( double x );
  373. long int __isnanf ( float x );
  374.  
  375. long int __signbit  ( long double x );
  376. long int __signbitd ( double x );
  377. long int __signbitf ( float x );
  378.  
  379. double_t __inf ( void );
  380.  
  381. /*******************************************************************************
  382. *                              Non NCEG extensions                             *
  383. *******************************************************************************/
  384.  
  385. #ifndef __NOEXTENSIONS__
  386.  
  387. /*******************************************************************************
  388. *                              Financial functions                             *
  389. *******************************************************************************/
  390.  
  391. /*    compound computes the compound interest factor "(1 + rate) ^ periods"
  392.       more accurately than the straightforward computation with the Power
  393.       function.  This is SANE's compound function.                            */
  394.  
  395. double_t compound ( double_t rate, double_t periods );
  396.  
  397. /*    The function annuity computes the present value factor for an annuity 
  398.       "( 1 - ( 1 + rate ) ^ ( - periods ) ) / rate" more accurately than the
  399.       straightforward computation with the Power function. This is SANE's 
  400.       annuity function.                                                       */
  401.  
  402. double_t annuity ( double_t rate, double_t periods );
  403.  
  404. /*******************************************************************************
  405. *                              Random function                                 *
  406. *******************************************************************************/
  407.  
  408. double_t randomx ( double_t *x );
  409.  
  410. /*******************************************************************************
  411. *                              Relational operator                             *
  412. *******************************************************************************/
  413.  
  414. typedef short relop;                         /*      relational operator      */
  415.  
  416. enum 
  417.       {
  418.       GREATERTHAN = ( ( relop ) ( 0 ) ),
  419.       LESSTHAN,
  420.       EQUALTO,
  421.       UNORDERED
  422.       };
  423.  
  424. relop relation ( double_t x, double_t y );
  425.  
  426. /*******************************************************************************
  427. *                         Binary to decimal conversions                        *
  428. *******************************************************************************/
  429.  
  430. #if    GENERATINGPOWERPC
  431. #define      SIGDIGLEN      36               /*    significant decimal digits */
  432. #else
  433. #define      SIGDIGLEN      20               /*    significant decimal digits */
  434. #endif
  435.  
  436. #define      DECSTROUTLEN   80               /* max length for dec2str output */
  437. #define      FLOATDECIMAL   ((char)(0))
  438. #define      FIXEDDECIMAL   ((char)(1))
  439.  
  440. /*    The decimal record type provides an intermediate unpacked form for
  441.       programmers who wish to do their own parsing of numeric input or
  442.       formatting of numeric output.                                           */
  443.     
  444. struct decimal 
  445.      {
  446.       char sgn;                              /*         sign 0 for +, 1 for - */
  447.       char unused;
  448.       short exp;                             /*              decimal exponent */
  449.       struct
  450.             {
  451.             unsigned char length;
  452.             unsigned char text[SIGDIGLEN];   /*            significant digits */
  453.             unsigned char unused;
  454.             }sig;
  455.       };
  456.  
  457. typedef struct decimal decimal;
  458.  
  459. /*    Each conversion to a decimal string is controlled by a decform
  460.       structure.  The style is either FLOATDECIMAL or FIXEDDECIMAL defined
  461.       above.  The value of digits is the number of significant digits for
  462.       FLOATDECIMAL.  The value of digits for FIXEDDECIMAL is the number of
  463.       digits to the right of the decimal point.                               */
  464.  
  465. struct decform 
  466.       {
  467.       char style;                            /*  FLOATDECIMAL or FIXEDDECIMAL */
  468.       char unused;
  469.       short digits;
  470.       };
  471.  
  472. typedef struct decform decform;
  473.  
  474. /*    Each conversion to a decimal record d via the function call num2dec is 
  475.       controlled by a decform record f (defined earlier), to a double_t x.    */
  476.  
  477. void num2dec ( const decform *f, double_t x, decimal *d );
  478.  
  479. /*    dec2num converts a decimal record d to a double_t value.                */
  480.  
  481. double_t dec2num ( const decimal *d );
  482.  
  483. /*    The MathLib formatter dec2str is controlled by a decform f.  Input d is
  484.       a decimal record.                                                       */
  485.  
  486. void dec2str ( const decform *f, const decimal *d, char *s );
  487.  
  488. /*    The function str2dec is the MathLib scanner.                            */
  489.  
  490. void str2dec ( const char *s, short *ix, decimal *d, short *vp ); 
  491.  
  492. /*    dec2d is similar to dec2num except a double is returned on 68k platforms*/
  493.  
  494. #if  GENERATING68K
  495. double dec2d ( const decimal *d );
  496. #endif
  497.  
  498. /*    dec2f is similar to dec2num except a float is returned.                 */
  499.  
  500. float dec2f ( const decimal *d );
  501.  
  502. /*    dec2s is similar to dec2num except a short is returned.                 */
  503.  
  504. short int dec2s ( const decimal *d );
  505.  
  506. /*    dec2l is similar to dec2num except a long is returned.                  */
  507.  
  508. long int dec2l  ( const decimal *d );
  509.  
  510. /*******************************************************************************
  511. *                    68k-only Transfer Function Prototypes                     *
  512. *******************************************************************************/
  513.  
  514. #if GENERATING68K
  515. #if GENERATING68881
  516.  
  517. void x96tox80 ( const long double *x, extended80 *x80 );
  518. void x80tox96 ( const extended80 *x80, long double *x );
  519.  
  520. #else
  521.  
  522. void x96tox80 ( const extended96 *x96, long double *x );
  523. void x80tox96 ( const long double *x, extended96 *x96 );
  524.  
  525. #endif      /* GENERATING68881   */
  526. #endif      /* GENERATING68K */
  527.  
  528. #endif      /* __NOEXTENSIONS__ */
  529.  
  530. /*******************************************************************************
  531. *                         PowerPC-only Function Prototypes                     *
  532. *******************************************************************************/
  533.  
  534. #if  GENERATINGPOWERPC
  535.  
  536. long double cosl ( long double x );
  537. long double sinl ( long double x );
  538. long double tanl ( long double x );
  539.  
  540. long double acosl ( long double x );          /*  result is in [0,pi]         */
  541. long double asinl ( long double x );          /*  result is in [-pi/2,pi/2]   */
  542. long double atanl ( long double x );          /*  result is in [-pi/2,pi/2]   */
  543. long double atan2l ( long double y, long double x );
  544.  
  545. long double coshl ( long double x );
  546. long double sinhl ( long double x );
  547. long double tanhl ( long double x );
  548.  
  549. long double acoshl ( long double x );
  550. long double asinhl ( long double x );
  551. long double atanhl ( long double x );
  552.  
  553. long double expl ( long double x );
  554. long double expm1l ( long double x );
  555. long double exp2l  ( long double x );
  556.  
  557. long double frexpl ( long double x, int *exponent );
  558. long double ldexpl ( long double x, int n );
  559.  
  560. long double logl ( long double x );
  561. long double log1pl ( long double x );
  562. long double log10l ( long double x ); 
  563. long double log2l ( long double x );
  564.  
  565. long double logbl ( long double x );
  566. long double scalbl ( long double x, long int n ); 
  567.  
  568. long double fabsl ( long double x );
  569. long double hypotl ( long double x, long double y );
  570. long double powl   ( long double x, long double y );
  571. long double sqrtl  ( long double x );
  572.  
  573. long double erfl  ( long double x );     /*   the error function              */
  574. long double erfcl ( long double x );     /*   complementary error function    */
  575. long double gammal ( long double x );
  576. long double lgammal ( long double x );
  577.  
  578. long double ceill  ( long double x );
  579. long double floorl ( long double x );
  580. long double rintl ( long double x );
  581. long double nearbyintl ( long double x );
  582. long int rinttoll ( long double x );
  583. long double roundl ( long double x );
  584. long int roundtoll ( long double round );
  585. long double truncl ( long double x );
  586. long double remainderl ( long double x, long double y );
  587. long double remquol    ( long double x, long double y, int *quo );
  588. long double copysignl ( long double x, long double y );
  589. long double fdiml ( long double x, long double y );
  590. long double fmaxl ( long double x, long double y );
  591. long double fminl ( long double x, long double y );
  592.  
  593. #ifndef __NOEXTENSIONS__
  594.  
  595. relop relationl ( long double x, long double y );
  596. void x80told ( const extended80 *x80, long double *x );
  597. void ldtox80 ( const long double *x, extended80 *x80 );
  598.  
  599. /*    MathLib v2 has two new transfer functions: x80tod and dtox80.  They can 
  600.       be used to directly transform 68k 80-bit extended data types to double
  601.       and back for PowerPC based machines without using the functions
  602.       x80told or ldtox80.  Double rounding may occur.                         */
  603.  
  604. double x80tod ( const extended80 *x80 );
  605. void dtox80   ( const double *x, extended80 *x80 );
  606.  
  607. void num2decl ( const decform *f, long double x, decimal *d );
  608. long double dec2numl ( const decimal *d );
  609.  
  610. #endif      /* __NOEXTENSIONS__ */
  611.  
  612. #endif      /* GENERATINGPOWERPC  */
  613.  
  614. #ifdef __cplusplus
  615. }
  616. #endif
  617.  
  618. #endif      /* __FP__          */
  619.